﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AiLuWeb.WebSite.Code;
using Ajeelee.Core.Utils;

namespace AiLuWeb.WebSite.WebAdmin
{
    public partial class WebSiteManage : AuthPageBase
    {
        protected WebSiteConfig topCompanys = new WebSiteConfig();
        protected void Page_Load(object sender, EventArgs e)
        {
            topCompanys = WebSiteConfigManager.GetWebSiteConfig();

            if (IsPost)
            {
                topCompanys = new WebSiteConfig();

                topCompanys.CompanyName = FormParam("CompanyName");
                topCompanys.Email = FormParam("Email");
                topCompanys.SinaWeiBo = FormParam("SinaWeiBo");
                topCompanys.QQWeiBo = FormParam("QQWeiBo");
                topCompanys.WeiXin = FormParam("faceImg");
                topCompanys.QQ = FormParam("QQ");
                topCompanys.ICP = FormParam("ICP");
                topCompanys.Link1 = FormParam("Link1") + "|" + FormParam("LinkName1");
                topCompanys.Link2 = FormParam("Link2") + "|" + FormParam("LinkName2");
                topCompanys.Link3 = FormParam("Link3") + "|" + FormParam("LinkName3");
                topCompanys.Link4 = FormParam("Link4") + "|" + FormParam("LinkName4");
                topCompanys.Share = FormParam("Share");
                topCompanys.Tongji = FormParam("Tongji");

                string path = Function.GetMapPath(WebSiteConfigManager.configFile);
                topCompanys.SerializeXmlFile(path);
                Function.RemoveCacheObject(WebSiteConfigManager.cacheKey);

                Page_GoTo("WebSiteManage.aspx");
            }
        }
    }
}